﻿cmake_minimum_required(VERSION 2.8)

set(BUILD_PROJECT_NAME "base")

if(WIN32)
set(SRC_LIST
	${CMAKE_CURRENT_SOURCE_DIR}/systemdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/processordetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/compilerdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/logging.h
	${CMAKE_CURRENT_SOURCE_DIR}/logging.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/basictypes.h
	${CMAKE_CURRENT_SOURCE_DIR}/constructormagic.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/criticalsection.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread.h
	${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread_annotations.h
	${CMAKE_CURRENT_SOURCE_DIR}/buffer.h
	${CMAKE_CURRENT_SOURCE_DIR}/refcount.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ref_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/sigslot.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/compile_assert.h
	${CMAKE_CURRENT_SOURCE_DIR}/move.h
	${CMAKE_CURRENT_SOURCE_DIR}/template_util.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/socketfactory.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/dscp.h
	${CMAKE_CURRENT_SOURCE_DIR}/socket.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/byteorder.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nullsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.h
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.h
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/asyncresolverinterface.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/win32socketinit.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32socketinit.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/winping.h
	${CMAKE_CURRENT_SOURCE_DIR}/winping.cpp
)

SOURCE_GROUP(base FILES
	${CMAKE_CURRENT_SOURCE_DIR}/systemdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/processordetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/compilerdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/logging.h
	${CMAKE_CURRENT_SOURCE_DIR}/logging.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/basictypes.h
	${CMAKE_CURRENT_SOURCE_DIR}/constructormagic.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/criticalsection.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread.h
	${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread_annotations.h
	${CMAKE_CURRENT_SOURCE_DIR}/buffer.h
	${CMAKE_CURRENT_SOURCE_DIR}/refcount.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ref_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/sigslot.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/compile_assert.h
	${CMAKE_CURRENT_SOURCE_DIR}/move.h
	${CMAKE_CURRENT_SOURCE_DIR}/template_util.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/socketfactory.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/dscp.h
	${CMAKE_CURRENT_SOURCE_DIR}/socket.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/byteorder.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nullsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.h
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.h
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/asyncresolverinterface.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/win32socketinit.h
	${CMAKE_CURRENT_SOURCE_DIR}/win32socketinit.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/winping.h
	${CMAKE_CURRENT_SOURCE_DIR}/winping.cpp
)
else()
set(SRC_LIST
	${CMAKE_CURRENT_SOURCE_DIR}/systemdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/processordetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/compilerdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/logging.h
	${CMAKE_CURRENT_SOURCE_DIR}/logging.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/basictypes.h
	${CMAKE_CURRENT_SOURCE_DIR}/constructormagic.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/criticalsection.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread.h
	${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread_annotations.h
	${CMAKE_CURRENT_SOURCE_DIR}/buffer.h
	${CMAKE_CURRENT_SOURCE_DIR}/refcount.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ref_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/sigslot.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/compile_assert.h
	${CMAKE_CURRENT_SOURCE_DIR}/move.h
	${CMAKE_CURRENT_SOURCE_DIR}/template_util.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/socketfactory.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/dscp.h
	${CMAKE_CURRENT_SOURCE_DIR}/socket.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/byteorder.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nullsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.h
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.h
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/asyncresolverinterface.h
)

SOURCE_GROUP(base FILES
	${CMAKE_CURRENT_SOURCE_DIR}/systemdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/processordetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/compilerdetection.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.h
	${CMAKE_CURRENT_SOURCE_DIR}/common.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/logging.h
	${CMAKE_CURRENT_SOURCE_DIR}/logging.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/basictypes.h
	${CMAKE_CURRENT_SOURCE_DIR}/constructormagic.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.h
	${CMAKE_CURRENT_SOURCE_DIR}/stream.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringencode.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.h
	${CMAKE_CURRENT_SOURCE_DIR}/timeutils.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/criticalsection.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagequeue.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.h
	${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread.h
	${CMAKE_CURRENT_SOURCE_DIR}/thread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/thread_annotations.h
	${CMAKE_CURRENT_SOURCE_DIR}/buffer.h
	${CMAKE_CURRENT_SOURCE_DIR}/refcount.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/scoped_ref_ptr.h
	${CMAKE_CURRENT_SOURCE_DIR}/sigslot.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.h
	${CMAKE_CURRENT_SOURCE_DIR}/checks.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/compile_assert.h
	${CMAKE_CURRENT_SOURCE_DIR}/move.h
	${CMAKE_CURRENT_SOURCE_DIR}/template_util.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.h
	${CMAKE_CURRENT_SOURCE_DIR}/event.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/socketfactory.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncsocket.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/dscp.h
	${CMAKE_CURRENT_SOURCE_DIR}/socket.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/socketaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.h
	${CMAKE_CURRENT_SOURCE_DIR}/ipaddress.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/byteorder.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/physicalsocketserver.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nullsocketserver.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.h
	${CMAKE_CURRENT_SOURCE_DIR}/asyncfile.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.h
	${CMAKE_CURRENT_SOURCE_DIR}/nethelpers.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.h
	${CMAKE_CURRENT_SOURCE_DIR}/signalthread.cpp
	${CMAKE_CURRENT_SOURCE_DIR}/asyncresolverinterface.h
)
endif()

add_library(${BUILD_PROJECT_NAME} STATIC ${SRC_LIST})




